/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hackathon;

import com.sun.lwuit.Font;
import com.sun.lwuit.plaf.UIManager;
import com.sun.lwuit.util.Resources;
import java.io.IOException;
import javax.microedition.lcdui.Command;

/**
 *
 * @author quangvucntt
 */

public class activity_mokde {
    private static final int LANGUAGE_COMMAND = 8;
    private Resources res;
    //private static final Command languageCommand = new Command("Chinese", LANGUAGE_COMMAND);
    //private static String localLanguage  = "en";
    private static String localLanguage;
    /**
     * @param args the command line arguments
     */
    double[] activity_mode= new double[3];
    public double[] activity_mode(){
        //double[] activity_mode= new double[3];
        //activity_mode[0] = 0.9;//sleeping
        activity_mode[0] = 2.3;//walking, 2.5 mph (4 km/h)
        activity_mode[1] = 2.9;//walking, 2.5 mph (4.8 km/h)
        activity_mode[2] = 4.0;//bicycling, <10 mph (16 km/h), leisure, to work or for pleasure
        return activity_mode;
    }
    String _activiti_mode;
    /*
     * get hoat dong cua 
     * 
     */
    public String getName_Activity_mode(int i){
        /*
        if(i == 0){
            _activiti_mode = _activiti_mode +"Ngủ";
            return _activiti_mode;
        }
        */
        if(i == 0){
            _activiti_mode = _activiti_mode +"Đi bộ";
            return _activiti_mode;
        }
        if(i == 1){
            _activiti_mode = _activiti_mode +"Chạy bộ";
            return _activiti_mode;
        }
        if(i == 2){
            _activiti_mode = _activiti_mode +"Đi xe đạp";
            return _activiti_mode;
        }
        return "";
        //return _activiti_mode;
    }
    /*
     * lay cac tham so
     */
    public double get_Activity_mode(int i){
        /*
        if(i == 0){
            
            return 0.9;
        }
        */
        if(i == 0){
            
            return 2.3;
        }
        if(i == 1){
            
            return 2.9;
        }
        if(i == 2){
            
            return 4.0;
        }
        return 1;
        //return _activiti_mode;
    }
    
    // luu thong tin cac che do
    public void saveInfomation(){
        
    }
    public void getInformaion(){
        if (localLanguage != null) {
            try {
                Resources res = Resources.open("/thongtin.res");
                System.out.println("opened");
                UIManager.getInstance().setResourceBundle(res.getL10N("localize", localLanguage));
                // don't use bitmap fonts for localization since we still want to run on low end devices!
                System.out.println("ok getInstance");
                if (!"en".equals(localLanguage)) {
                    Font.setBitmapFontEnabled(false);
                }
                
            }
            catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    }
    public String[] getTT1() {
        
        String[] s= new String[4];
        String[] h= new String[4];
        for (int i = 0; i <= 3; i++) {
            int m= i+1;
            h[i]= "thongtin"+m;
            s[i]= UIManager.getInstance().localize(h[i], "");
        }
        return s;
    }   
        //
        public String getTT11() {
        String s ="";
        s = UIManager.getInstance().localize("thongtin1", "");
        //return UIManager.getInstance().localize("thongtin1", "");
        return s;
    }
    public String[] getTT2() {
        
        String[] s= new String[4];
        String[] h= new String[4];
        for (int i = 0; i <= 3; i++) {
            int m= i+5;
            h[i]= "thongtin"+m;
            
            s[i]= UIManager.getInstance().localize(h[i], "");
        }
        //return UIManager.getInstance().localize("thongtin1", "");
        return s;
        
    }

}
